<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	 <%@ include file="/common/meta.jsp" %>
 	 <%@ include file="/common/import.jsp"%>
    <base href="<%=basePath%>">
    
    <title>会员列表页面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
		#userRegTable,#editTable
		  {
		  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
		  width:50%;
		  border-collapse:collapse;
		  }
		
		#userRegTable td,#editTable td, #customers th,#editTable th 
		  {
		  font-size:1em;
		  border:1px solid #98bf21;
		  padding:3px 7px 2px 7px;
		  }
		
		#userRegTable th,#editTable th
		  {
		  font-size:1.1em;
		  text-align:left;
		  padding-top:5px;
		  padding-bottom:4px;
		  background-color:#A7C942;
		  color:#ffffff;
		  }
		
		 .alt
		  {
		  color:#000000;
		  background-color:#EAF2D3;
		  }
	</style>
	</script>
	<script type="text/javascript">
		$(function(){
			//控制div显示和隐藏
			$('#tab_search').panel({
				iconCls : "icon-search",//图标
				collapsible : true,//是否可折叠面板
				collapsed : true,//是否初始化折叠面板
				title : "查询会员"//标题
			});
			$('#dataCateList').datagrid({
				title:'会员个人修改申请',
				iconCls:'icon-ok',
				url:"${ctx}/admin/member/queryMemberByLevelAndStatus.action?status=1",
				nowrap: false,
				striped: true,
				collapsible:false,				
				fitColumns: true,
				pagination:true,
				singleSelect:true,
				rownumbers:true,
				remoteSort: false,
				pageList:[15,20,30,50],
				idField:'memberId',
				columns:[[
					{field:'memberEname',title:'会员名称',width:50},
					{field:'memberCname',title:'会员全称',width:50},
					{field:'shortName',title:'会员简称',width:50},
					{field:'memberType',title:'会员属性',width:50,
						formatter:function(value){
							if( value == '20'){return '个人';}
							else{ return '机构';}
						}
					},{field:'memberLevel',title:'会员级别',width:50,
						formatter:function(value){
							if( value == '1'){return '普通会员';}
							else if(value == '2'){return '认证会员';}
							else if(value == '3'){return '正式会员';}
							else{ return '未定级';}
						}
					},
					{field:'op',title:'操作',width:50,
						formatter : function(value, member) {
							var info = "";
							info += "<a href=\"javascript:void(0)\" onclick=\"editCate('"
									+ member.memberId
									+ "')\" style=\"color: blue\" >申请修改</a> ";
							return info;
						}
					}
				]],
				toolbar:[{
					text:'刷新',
					iconCls:'icon-reload',
					handler:function(){
						$('#dataCateList').datagrid('reload');
					}
				}
				]
			});		
		});
		
		// 刷新列表
		function cateReload(){
			$('#dataCateList').datagrid('reload');
		}
		
		// 查找
		function searchCate(){
			var queryParams = $('#dataCateList').datagrid('options').queryParams;
			var opt = $('#dataCateList').datagrid('options');
			$('#dataCateList').datagrid('options').pageNumber = 1;
			queryParams["memberEname"] = $('#memberEname').val();
			queryParams["memberCname"] = $('#memberCname').val();
			queryParams["shortName"] = $('#shortName').val();
			var page = $('#dataCateList').datagrid('getPager');
			page.pagination({
				pageNumber : 1,
				pageSize : opt.pageSize
			});
			$('#dataCateList').datagrid('reload');
		}
		
	     //关闭win
		 function closeWin(){
		 	$('#saveDiv').window('close');	
		 }	 
		
		// 进入认证申请页面
		function editCate(memberId){
			$.ajax({
				type:'post',
				url:"${ctx}/member/memberTemp/checkMemberApply.action?memberId="+ memberId,
				dataType:'json',
				success:function(data){
				     var flag = data.flag;
				     var msg = data.msg;
				     if(flag=="T"){
					  	 window.location.href = "${ctx}/member/memberTemp/toMemberPersonEdit.action?memberId=" + memberId;	
				     }else{
				    	 $.messager.alert('温馨提示', msg, 'error');
				    	 return false;
				     }
				},
				error:function(){
					 alert("请检查服务器！");
					}
				});	
		}
		
	</script>

  </head>
  <body>
  		<!-- 查询窗口 -->
  	 	<div id="tab_search">

			<table class="datagrid-body" >
				<tr>	
					<td class="datagrid-header">用户账号：</td>
					<td><input type="text" id="memberEname" name="memberEname" size="30" value="" /></td>
				</tr>
				
				<tr >
					<td class="datagrid-header">用户名称：</td>
					<td><input type="text" id="memberCname" name="memberCname" size="30" value="" /></td>
				</tr>
	
			
				<tr>	
					<td class="datagrid-header"></td>
					<td><a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" onClick="searchCate();">查找</a></td>	
				</tr>
			</table>

		</div>
     <table id="dataCateList"></table>
  </body>
</html>
